import java.util.Arrays;

public class Test {
        public int aMethod(){
            static int i = 0;
            i++;
            return i;
        }
        public static void main(String args[]){
            Test test = new Test();
            test.aMethod();
            int j = test.aMethod();
            System.out.println(j);
        }
    }
    public static void main7(String[] args) {
        int [] arr = {2,7,5,1,8,4,6};
        for (int i = 0; i < arr.length-1; i++) {
            for (int j = 0; j < arr.length-1-i; j++) {
                if(arr[j]>arr[j+1]){
                    int tmp = arr[j];
                    arr[j] = arr[j+1];
                    arr[j+1] = tmp;
                }
            }
        }
        System.out.println(Arrays.toString(arr));
    }
    public static void main6(String[] args) {
        int [] arr = {1,2,3,4,5,6};
        int key = 3;
       int c =  BinarySearch(arr,key);
        System.out.println(c);
    }
    public static int BinarySearch(int[] arr,int key){
        int left = 0;
        int right = arr.length-1;
        while(left<=right){
            int mid = (left+right)/2;
            if(arr[mid]==key){
                return key;
            }else if(arr[mid]<key){
                left = mid+1;
            }else{
                right = mid-1;
            }
        }
        return -1;
    }

    public static void main5(String[] args) {
        int[] arr ={1,1,5,5,8,8,9,9,6};
        int dif = 0;
        for (int i = 0; i < arr.length; i++) {
            dif ^=arr[i];
        }
        System.out.println(dif);
    }
    public static void main4(String[] args) {
        int [] arr = {1,1,1,7,7,7,7,7,7,7,7,7,7,7,7,7,9,9,5,5,5,5,5,};
        Arrays.sort(arr);
        int c = arr.length/2;
        System.out.println(arr[c]);
    }
    public static void main3(String[] args) {
        int[] arr = {1,2,34,3,4,5,7,23,12};
       boolean ret =  fun(arr);
        System.out.println(ret);
    }

    public static boolean fun(int[]arr) {
        int count = 0;
        for (int i = 0; i < arr.length-1; i++) {
            if(arr[i]%2!=0){
                count++;
                if(count == 3){
                    return true;
                }
            }else{
                count = 0;
            }
        }
        return false;
    }
    public static void main2(String[] args) {
        int tager = 9;
        int array[] = {1,2,3,4,56,8};
       int[] c = twonum(array,tager);
        System.out.println(Arrays.toString(c));
    }
    public static int[] twonum(int[]array,int tager){
        int[] ret = new int[]{-1,-1};
    int left = 0;
    int right = left+1;
    for(left = 0; left<array.length-1;left++){
        for (right = left+1;right<array.length;right++){
            if(array[left]+array[right]==tager){
                ret[0] = left;
                ret[1] = right;
                return ret;


            }
        }
    }
    return ret;
    }
    public static void Fun(int[] array) {
            int left = 0;
            int right = array.length-1;
            while(left<right){
                while(left < right && array[left]%2!=0){
                    left++;
                }
                while(left<right && array[right]%2==0){
                    right--;
                }
                if(left < right){
                    int tmp = array[left];
                    array[left] = array[right];
                    array[right] = tmp;
                }
                left++;
                right--;
            }
    }
    public static void main1(String[] args) {
        int[] array = {1,2,3,4,5,6};
        Fun(array);
        System.out.println(Arrays.toString(array));
    }
}
